﻿@model ManualReg
<form class="form-horizontal uiform" method="post"
      data-modal="true"
      data-table=".uitable"
      data-error-el=".alert-danger"
      data-on-submit-success="fx.mtfSuccess"
      action="@Url.Action("Save")">
    <div class="modal-header">
        <button class="close" data-dismiss="modal" type="button" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">@Html.EditStatus("稽查登记")</h4>
    </div>
    <div class="modal-body">
        @Html.AntiForgeryToken()
        @Html.MarkCreate()
        @Html.HiddenFor(p => p.Id)
        <div class="alert alert-danger fxhide"></div>
        <table class="table table-bordered table-striped table-details">
            <tr>
                <th class="w100px"><span style="color:#F00"> * </span>车牌号</th>
                <td>
                    <input class="form-control" name="@nameof(Model.CarNumber)" value="@Model.CarNumber"
                           data-validate="required: true,maxlength: 50"
                           data-validate-message="required:'请输入车牌号0'"
                           type="text" autocomplete="off" />
                </td>
                <th class="w120px"><span style="color:#F00"> * </span>实载乘客</th>
                <td>
                    <input class="form-control" name="@nameof(Model.ExitNumber)" value="@Model.ExitNumber"
                           data-validate="required: true,maxlength: 50"
                           data-validate-message="required:'请输入实载乘客数'"
                           @*data-validate-message="required:'请输入出站人数'"*@
                           type="text" autocomplete="off" />
                </td>
               
            </tr>
            <tr>
                <th>售票人数</th>
                <td>
                    <input class="form-control" name="@nameof(Model.PassengerNumber)"
                           value="@Model.PassengerNumber"
                           data-validate="maxlength: 50"
                           type="text" autocomplete="off" />
                </td>
                <th class="w100px">客运站</th>
                <td>
                    <select class="form-control uiselect" name="@nameof(Model.Station)"
                            data-text-field="StationName"
                            data-validate="maxlength: 4"
                            data-width="165"
                            data-validate-message="required:'请选择所属客运站'">
                        <option></option>
                        @Html.StationCategoryOption(Model.Station)
                    </select>
                </td>
            </tr>
            <tr>
                <th>司机姓名</th>
                <td>
                    <input class="form-control" name="@nameof(Model.DriverName)" value="@Model.DriverName"
                           data-validate="maxlength: 50"
                           @*data-validate-message="required:'请输入司机姓名'"*@
                           type="text" autocomplete="off" />
                </td>
                <th>联系电话</th>
                <td>
                    <input class="form-control" name="@nameof(Model.DriverPhone)" value="@Model.DriverPhone"
                           data-validate="maxlength: 50"
                           @*data-validate-message="required:'请输入司机电话'"*@
                           type="text" autocomplete="off" />
                </td>
            </tr>
            <tr>
                <th>线路</th>
                <td>
                    <input class="form-control" name="@nameof(Model.Line)" value="@Model.Line"
                           data-validate="maxlength: 50"
                           @*data-validate-message="required:'请输入线路'"*@
                           type="text" autocomplete="off" />
                </td>
                <th>运输企业</th>
                <td>
                    <input class="form-control" name="@nameof(Model.Corp)" value="@Model.Corp"
                           data-validate="maxlength: 200"
                           @*data-validate-message="required:'请输入运输企业'"*@
                           type="text" autocomplete="off" />
                </td>
            </tr>
            <tr>
                <th>稽查状态</th>
                <td>
                    <select class="form-control uiselect checkstatus" name="@nameof(Model.CheckStatus)"
                            data-text-field="CheckStatusName"
                             
                            data-validate="maxlength: 4">
                            @*data-validate-message="required:'请选择稽查状态'">*@
                    <option></option>
                    @Html.CheckStatusCategoryOption(Model.CheckStatus.ToString())
                </select>
                </td>
                <th>稽查点名称</th>
                <td>
                    <select class="form-control uiselect" name="@nameof(Model.PointId)"
                            data-text-field="PointName"
                            data-validate="maxlength: 4">
                            @*data-validate-message="required:'请选择稽查点名称'">*@
                    <option></option>
                    @Html.CheckPointsCategoryOption(Model.PointId)
                </select>
                </td>
            </tr>
            <tr id="OffenceRow" style="display:none;">
                <th>违规内容</th>
                <td>
                    <select class="form-control uiselect" name="@nameof(Model.OffenceId)"
                            data-text-field="OffenceName"
                            data-validate="maxlength: 4">
                            @*data-validate-message="required:'请选择状态'">*@
                    <option></option>
                    @Html.OffenceIdCategoryOption(Model.OffenceId)
                </select>
                </td>
                <th>处理结果</th>
                <td>
                    <select class="form-control uiselect" name="@nameof(Model.ProcessStatus)"
                            data-text-field="ProcessStatusName"
                            data-validate="maxlength: 4">
                            @*data-validate-message="required:'请选择处理结果'">*@
                    <option></option>
                    @Html.ProcessStatusCategoryOption(Model.ProcessStatus)
                </select>
                </td>
            </tr>
            <tr>
                <th>备注</th>
                <td colspan="3">
                    <textarea class="form-control" name="@nameof(Model.Note)" rows="3">@Model.Note</textarea>
                </td>
            </tr>
        </table>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="submit">
            <i class="fa fa-save"></i> 保存
        </button>
        <button class="btn btn-default" type="button" data-dismiss="modal">
            <i class="fa fa-sign-in"></i> 关闭
        </button>
    </div>
</form>
<script>
    $('.checkstatus').on("change", function (e) {
        showcheckstatus();
    });

    function showcheckstatus() {
        if ($('.checkstatus').val() == '1') { //违规
            $('#OffenceRow').show();
        }
        else {
            $('#OffenceRow').hide();
        }
    }

    showcheckstatus();

</script>